# the minimum version of CMake.
cmake_minimum_required(VERSION 3.4.1)

# 工程名字(不代表输出应用名称)
project(MyCppApp)

# 相当于-I
include_directories(${CMAKE_SOURCE_DIR}/../../../lib/include)

# 相当于-L
link_directories(${CMAKE_SOURCE_DIR}/../../../lib/arm64-v8a)
link_directories(${CMAKE_SOURCE_DIR}/../../../libs/arm64-v8a)

# 把.cpp文件编译为.so, 并打包进hap
add_library(testjni SHARED testjni.cpp)
add_library(ffjni SHARED ffjni.cpp ffcodec.cpp)

#其它编译项
# add_definitions(-O3 -Wall)

# 编译目标时的依赖关系
target_link_libraries(
    testjni
    libhilog_ndk.z.so
    libtest.so)
target_link_libraries(
    ffjni
    libhilog_ndk.z.so
    libavcodec.a
    libavfilter.a
    libavformat.a
    libavresample.a
    libavutil.a
    libswresample.a
    libswscale.a
    libpostproc.a
    libfontconfig.a
    libxml2.a
    libvo-amrwbenc.a
    librtmp.a
    libx264.a
    libvpx.a
    libmp3lame.a
    libcurl.a
    libssl.a
    libcrypto.a
    libfreetype.a
    libpng12.a
    libz.a
    dl) # 系统库-ldl, 用于修复x264找不到dlopen()
